home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / EXAMPLE_PROGRAMS / example23_1.AMOS / example23_1.amosSourceCode
AMOS Source Code  |  1992-02-26  |  1KB  |  36 lines

  1. '================
  2. 'Example23_1.Amos
  3. '================
  4.  
  5. Rem a quick look at LEFT$, RIGHT$ and MID$ 
  6.  
  7.  
  8.  
  9. Flash Off : Curs Off : Hide : Paper 0 : Cls 0
  10.  
  11. Rem The contents of A$ is the text we are going to be working on 
  12. '--------------------------------------------------------------- 
  13. A$="TESTING AMOS"
  14. Pen 4 : Print A$
  15. Print 
  16. Pen 5
  17.  
  18. Rem let's do LEFT$ first. We want to cut out the word TESTING from A$
  19. Rem and put it into B$. We will then PRINT B$ to the screen. 
  20. Rem As TESTING is 7 letters long from the LEFT, we do this:
  21. '------------------------------------------------------------
  22. B$=Left$(A$,7)
  23. Print "LEFT$  7=";B$
  24. Print 
  25.  
  26. Rem Now RIGHT$. Let's cut out the word AMOS
  27. '------------------------------------------
  28. B$=Right$(A$,4)
  29. Print "RIGHT$ 4=";B$
  30. Print 
  31.  
  32. Rem MID$ allows you to define the start and the length of the piece you  
  33. Rem wish to extract. The 1 is the start character and the 4 the length.
  34. '----------------------------------------------------------------------
  35. B$=Mid$(A$,1,4)
  36. Print "MID$ 1,4=";B$